﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DemoAutofac.Models {
    public interface ILog {        
        void log(string message);
        string loggerName {
            get;
        }
    }
    
    public class SQLLog : ILog {
        private string _connection = "default";
        private int _level;
        private static string _loggerName = "SQL";

        public SQLLog() {            
        }
        public SQLLog(string connection) {
            _connection = connection;
        }
        public SQLLog(int level) {
            _level = level;
        }

        public string loggerName {
            get {
                return _loggerName;
            }
        }
        public string getLoggerName() {
            return "SQLog";
        }

        public void log(string message) {
            Console.WriteLine("{0}-{1} : {2}", this.loggerName, _connection, message);
        }
    }

    public class HttpLog : ILog {
        private static string _loggerName = "HttpLog";
        public string loggerName {
            get {
                return _loggerName;
            }
        }

        public string logservice {  get; set; }

        public void log(string message) {
            Console.WriteLine("{0} - {1}: {2}", this.loggerName, this.logservice, message);
        }
    }
}
